"""
   -*- coding: utf-8 -*-
   @Time    : 2021/3/25 8:30
   @Author  : 狠欢
   @File    : 流程控制作业.py
   @Software: PyCharm
"""
# 猜数字
# • 在程序内定义一个数字，让用户猜
# • 检查用户输入的是否为数字
# • 键盘接收用户输入，猜对或猜错都给出提示（大/小）
# • 最多能猜3次
# • 给出用户最终猜的结果，及花了几次来猜
# import random
# get_shuzi = random.randint(1, 100)
# print(get_shuzi)
# count = 1
# while count <= 3:
#     input_shuzi = input("请输入您猜的数字：")
#     if not input_shuzi.isdigit():
#         print(f"您还有{3-count}次机会", "请输入数字谢谢")
#         count += 1
#         continue
#     else:
#         if int(input_shuzi) > int(get_shuzi):
#             print("您输入数字过大", f"您还有{3-count}次机会")
#             count += 1
#         elif int(input_shuzi) < int(get_shuzi):
#             print("您输入数字过小", f"您还有{3-count}次机会")
#             count += 1
#         else:
#             print("恭喜你猜对了"f"您用了{count}次机会")
#             break


# 打印100-500以内的质数（只能被1和自己整除的数）
# b = 2
# for i in range(100, 501):
#     for j in range(2, i):
#         if i % j == 0:
#             break
#     else:
#         print(i)


# 打印1-50以内整数的和
# num = 0
# for i in range(1, 51):
#     num += i
# print(num)


# 分数等级
# num1 = input("输入分数:")
#
# if not num1.isdigit():
#     print("请输入正确分数格式")
#
# else:
#     if 85 <= int(num1) <= 100:
#         print("优秀")
# 
#     elif 60 <= int(num1) < 85:
#         print("良好")
#
#     elif int(num1) < 60:
#          print("不及格")
#
#     else:
#         print("输入不合法，请重新输入")
#
#

